#ifndef SCOPE_H
#define SCOPE_H

#include <glib.h>

typedef struct _Scope Scope;
typedef struct _ScopeType ScopeType;

struct _Scope
{
	const ScopeType* type;
	Scope* enclosingScope;
	GHashTable* symbols;
};

struct _ScopeType
{
	int (*defineSymbol)(Scope*, gchar*, void*);
	int (*resolveSymbol)(Scope*, gchar*, void*);
};

extern const ScopeType scopeType;

Scope* Scope_init(Scope* self);

inline int Scope_defineSymbol(Scope* self, gchar* name, void* obj);
inline int Scope_resolveSymbol(Scope* self, gchar* name, void* obj);

#endif /* SCOPE_H */